   var _customIdeParentPath = "jslib/ide/";
   var syncIdeFunc;
   require([
	  _customIdeParentPath+"lib/codemirror", _customIdeParentPath+"mode/htmlmixed/htmlmixed",_customIdeParentPath+"addon/display/fullscreen", 
	  _customIdeParentPath+"addon/fold/foldcode", _customIdeParentPath+"addon/fold/foldgutter",
	  _customIdeParentPath+"addon/fold/xml-fold",_customIdeParentPath+"addon/fold/brace-fold",
	  _customIdeParentPath+"mode/xml/xml", _customIdeParentPath+"formatHtml/beautifyHtml",
	  _customIdeParentPath+"formatHtml/htmlformat",_customIdeParentPath+"formatHtml/jsformat",_customIdeParentPath+"addon/hint/show-hint", 
	  _customIdeParentPath+"addon/hint/css-hint", _customIdeParentPath+"addon/hint/javascript-hint",
	  _customIdeParentPath+"addon/hint/xml-hint",_customIdeParentPath+"addon/hint/html-hint"
	], function(CodeMirror) {
	  var doc = CodeMirror.fromTextArea(document.getElementById("code"), {			    
		lineNumbers: true,
		mode: "htmlmixed",
		theme: "eclipse",
		autoMatchParens:true,
		foldGutter: true,
		gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"],
		extraKeys: {
			"F11": function(cm) {
			  cm.setOption("fullScreen", !cm.getOption("fullScreen"));
			},
			"Esc": function(cm) {
			  if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
			},
			"Alt-/": "autocomplete"
		}
	  });
	  doc.setSize('100%', '100%');
	  doc.foldCode(CodeMirror.Pos(0, 0));
	  doc.foldCode(CodeMirror.Pos(21, 0));
	  
	  $("#formatListener").click(function(){			       
			var html = do_js_beautify("formatListener", doc.getValue());							
			doc.setValue(html);
	  })

	  syncIdeFunc = function(){
		  $("#code").val(doc.getValue());
	  }
	  
	});
   
   
   